import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
	scrollBehavior: () => ({
        y: 0
    }),
	mode:'history',
	linkActiveClass: 'active-link',
	linkExactActiveClass: 'exact-active-link',
	fallback: true,
	// base:'/cel/',
	routes: [
		{
			path: '/login',
			component: () =>
					import ('@/views/login'),
			meta: {
					requireAuth: false,
					title: '登录',
                    role:2,
				},
		},
		{
			path: '/register',
			component: () =>
					import ('@/views/register'),
			meta: {
					requireAuth: false,
					title: '注册',
                    role:2,
				},
		},
		{
			path: '/',
            redirect:'/indexPage',
			component: () =>
					import ('@/views/Layout'),
			children: [
                // 首页
                {
                    path: '/indexPage',
                    component: () =>
                        import ('@/views/indexPage'),
                    name: 'indexPage',
                    meta: {
                        requireAuth: true,
                        navActive: '/indexPage',
                        title: '首页'
                    }
                },// 讲师列表
                {
                    path: '/TeacherList',
                    component: () =>
                        import ('@/views/TeacherList'),
                    name: 'TeacherList',
                    meta: {
                        requireAuth: true,
                        navActive: '/TeacherList',
                        title: '讲师列表'
                    }
                },
                // 讲座列表
                {
                    path: '/LectureList',
                    component: () =>
                        import ('@/views/LectureList'),
                    name: 'LectureList',
                    meta: {
                        requireAuth: true,
                        navActive: '/LectureList',
                        title: '讲座列表',
                        role:2,
                    }
                },
                // 添加讲座
                {
                    path: '/AddLecture',
                    component: () =>
                        import ('@/views/AddLecture'),
                    name: 'AddLecture',
                    meta: {
                        requireAuth: true,
                        navActive: '/LectureList',
                        title: '添加讲座',
                        role:2,
                    }
                },
				//管理员列表
				{
					path: '/AdminList',
					component: () =>
						import ('@/views/AdminList'),
					name: 'AdminList',
					meta: {
						requireAuth: true,
						navActive: '/AdminList',
						title: '管理员列表'
					}
				},
				//单位列表
				{
					path: '/CompanyList',
					component: () =>
						import ('@/views/CompanyList'),
					name: 'CompanyList',
					meta: {
						requireAuth: true,
						navActive: '/CompanyList',
						title: '单位列表'
					}
				},
				//级别调整
				{
					path: '/LevelControl',
					component: () =>
						import ('@/views/LevelControl'),
					name: 'LevelControl',
					meta: {
						requireAuth: true,
						navActive: '/LevelControl',
						title: '级别调整'
					}
				},

				//宣讲查询
				{
					path: '/SearchTeach',
					component: () =>
						import ('@/views/SearchTeach'),
					name: 'SearchTeach',
					meta: {
						requireAuth: true,
						navActive: '/SearchTeach',
						title: '宣讲查询'
					}
				},
			]
		}
		// {
		// 	path: '*',
		// 	component: () => import('@/views/Teacher/errorPage'),
		// 	meta: {
		// 		title: '找不到页面'
		// 	}
		// },
	]
})
